import time
from time import sleep

from selenium import webdriver
from selenium.webdriver.common.by import By
d=webdriver.Edge()
d.get('http://127.0.0.1/ranzhi/www/')
time.sleep(2)
#输入用户名和密码功能  admin 123456
d.find_element('id','account').send_keys('admin')
d.find_element('id','password').send_keys('123456')
#2)	点击登陆按钮
d.find_element('id','submit').click()
time.sleep(3)
#3)	点击后台管理按钮
d.find_element('id','s-menu-superadmin').click()
time.sleep(8)
#切换到iframe
# 定位到iframe
iframe = d.find_element("id","iframe-superadmin")
d.switch_to.frame(iframe)
#点击添加成员
d.find_element("class name","shortcut.user").click()
sleep(2)
#切换到上一层
d.back()
sleep(3)
#点击签退
d.find_element("class name","sign.signout").click()
sleep(20)